refactor: reuse calculated fees#1462
Conversation
8ca3036 to
c6e0942
Compare
c6e0942 to
ae5ca7b
Compare
|
Just looking at title it seems effort is similar to Tao's tx meta. |
ae5ca7b to
3ff403c
Compare
|
Cached One version of |
|
Epoch boundaries aren't relevant to this PR refactoring because the fee that this PR is reusing is calculated during transaction loading / execution in the SVM. Epoch boundaries are only relevant when scheduling transactions in banking stage. This PR doesn't change any behavior in the banking stage and so I don't think this will conflict at all with tx meta work that @tao-stones is working on |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1462 +/- ##
=======================================
Coverage 82.7% 82.7%
=======================================
Files 876 876
Lines 371118 371045 -73
=======================================
- Hits 307263 307212 -51
+ Misses 63855 63833 -22 |
3ff403c to
abe1f46
Compare
There was a problem hiding this comment.
Agree caching FeeDetails at LoadedTransaction makes a lot sense in this PR - bank is going to collect exact fee that account_loader calculated and validated against payer account. My early commit is due to the concern that dev could accidentally cache and reuse LoadedTransaction (at banking stage) cross epoch boundary, even it's not intentional. Perhaps that's overly concerned? Other than that, the PR looks great.
Yeah, I don't think it's a valid concern because basically nothing in |
|
automerge label removed due to a CI failure |
Problem
Transaction fees are recalculated quite a few times in the transaction pipeline for no good reason
Summary of Changes
Store calculated fee details in
LoadedTransactionandTransactionExecutionDetailsso that fees don't need to be recalculated downstreamFixes #